//
//  YBPeopleInfoModel.m
//  GongXinDangJian
//
//  Created by apple on 17/11/30.
//  Copyright © 2017年 apple. All rights reserved.
//

#import "YBPeopleInfoModel.h"

@implementation YBPeopleInfoModel

-(CGFloat)nameWidth
{
    return [[NSString stringWithFormat:@"%@-%@" , [ToolClass returnNoNullStringWithString:self.F_DEPT_NAME] , [ToolClass returnNoNullStringWithString:self.NAME]] boundingRectWithSize:CGSizeMake([UIScreen zj_screenWith] - ItemWidth * 140, CGFLOAT_MAX) options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName : LYPFONT(15)} context:nil].size.width + 1;
}


-(CGFloat)selectNameWidth
{
    return [[NSString stringWithFormat:@"%@-%@" , [ToolClass returnNoNullStringWithString:self.F_DEPT_NAME] , [ToolClass returnNoNullStringWithString:self.NAME]] boundingRectWithSize:CGSizeMake([UIScreen zj_screenWith] - ItemWidth * 300, CGFLOAT_MAX) options:NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName : LYPFONT(15)} context:nil].size.width + 1;
}


+ (NSDictionary *)modelCustomPropertyMapper {
    return @{@"F_DEPT_NAME" : @[ @"F_DEPT_NAME" , @"PARTYMEMBER_DEPT_NAME"],
             @"NAME" : @[@"NAME" , @"PARTYMEMBER_NAME"]};
}

- (NSString *)description {
    return [self yy_modelDescription];
}


-(NSString *)ACCOUNT_ID
{
    if (_ACCOUNT_ID.length == 0) {
        return self.ID;
    }
    else{
        return _ACCOUNT_ID;
    }
}

@end
